package prototype.tools.init;

import prototype.listener.ServletContextListenerImpl;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

/**
 *
 */
public class InitUtils {
	public static EntityManager getEntityManager() {
		new ServletContextListenerImpl().contextInitialized(null);
		final EntityManagerFactory entityManagerFactory = ServletContextListenerImpl.getEntityManagerFactory();
		final EntityManager entityManager = entityManagerFactory.createEntityManager();
		return entityManager;
	}
}
